#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define LEN 1000
int main(int argc, char** argv)
{
	int i,j;
	int num[10] = {0};
	srand((unsigned int) time(0));
	int* ptd = (int*)malloc(LEN*sizeof(int));
	int *start = ptd;
	for(i=0; i<LEN; i++)
	{
		*start++ = rand() % 10+1;
	}	
	start = ptd;
	for(i=0; i<10; i++)
	{
		for(j=0; j<LEN; j++){
			if(*start++ == (i+1))
				num[i]+=1;
		}
		start = ptd;
	}
	for(i=0; i<10; i++)
		printf("%d appears %d\n",i+1, num[i]);
	
	free(ptd);
	return 0;
}
